package com.tedu.API.threadAPI;

/**
 *
 *
 */
public class RunnableAPI {
    public static void main(String[] args) {
        //创建 实现线程 对象 ---启动必须用start()
        MyRunnable1 mr1=new MyRunnable1();
        Thread t1=new Thread(mr1);
        t1.start();
        MyRunnable2 mr2=new MyRunnable2();
        Thread t2=new Thread(mr2);
        t2.start();
    }
}
class MyRunnable1 implements Runnable{
    public void run() {
        for (int i=0;i<100;i++){
            System.out.println("有花堪折直需折");
        }
    }
}
class MyRunnable2 implements Runnable{
    @Override
    public void run() {
        for (int i=0;i<100;i++){
            System.out.println("莫待无花空折枝");
        }
    }
}
